@mdzip/editor 1.3.11 → 1.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -0
- package/dist/library-info.d.ts +2 -2
- package/dist/library-info.js +2 -2
- package/dist/view-css.d.ts.map +1 -1
- package/dist/view-css.js +257 -53
- package/dist/view-css.js.map +1 -1
- package/dist/view.d.ts +91 -2
- package/dist/view.d.ts.map +1 -1
- package/dist/view.js +500 -35
- package/dist/view.js.map +1 -1
- package/dist/workspace-view.d.ts +1 -1
- package/dist/workspace-view.d.ts.map +1 -1
- package/dist/workspace-view.js +38 -3
- package/dist/workspace-view.js.map +1 -1
- package/dist/workspace.d.ts +1 -0
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +3 -1
- package/dist/workspace.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
# @mdzip/editor
|
|
7
7
|
|
|
8
|
+
[](https://www.npmjs.com/package/@mdzip/editor)
|
|
9
|
+
[](https://github.com/mdzip-project/mdzip-editor/blob/main/LICENSE)
|
|
10
|
+
|
|
8
11
|
Framework-independent MDZip workspace engine and browser view.
|
|
9
12
|
|
|
10
13
|
`@mdzip/editor` provides reusable helpers for opening `.mdz` archives, rendering Markdown previews, editing archive contents, comparing archive inventories, and embedding a configurable MDZip workspace UI.
|
|
@@ -107,6 +110,44 @@ workspace dirty.
|
|
|
107
110
|
- `standalone-editor`: full editor controls, including save.
|
|
108
111
|
- `hosted-editor`: editor controls without an embedded save button, for hosts such as VS Code that own persistence.
|
|
109
112
|
|
|
113
|
+
Call `setControls(nextControls)` to update the policy after construction
|
|
114
|
+
without rebuilding the workspace view. `lineNumbers` changes are applied to the
|
|
115
|
+
existing CodeMirror editor, preserving the current document and selection.
|
|
116
|
+
|
|
117
|
+
## Density and Spacing
|
|
118
|
+
|
|
119
|
+
Hosts can opt into smaller built-in UI without targeting private classes:
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
const view = new MdzipWorkspaceView(container, {
|
|
123
|
+
controls: 'hosted-editor',
|
|
124
|
+
toolbarDensity: 'compact', // 'comfortable' | 'compact' | 'dense'
|
|
125
|
+
contentDensity: 'compact' // 'comfortable' | 'compact'
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
view.setDensityOptions({
|
|
129
|
+
toolbarDensity: 'dense',
|
|
130
|
+
contentDensity: 'compact'
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
For exact sizing, set stable CSS custom properties on an ancestor of the
|
|
135
|
+
workspace:
|
|
136
|
+
|
|
137
|
+
```css
|
|
138
|
+
.studio-editor {
|
|
139
|
+
--mdzip-toolbar-button-size: 28px;
|
|
140
|
+
--mdzip-toolbar-compact-button-size: 26px;
|
|
141
|
+
--mdzip-toolbar-icon-size: 14px;
|
|
142
|
+
--mdzip-format-button-size: 26px;
|
|
143
|
+
--mdzip-format-icon-size: 14px;
|
|
144
|
+
--mdzip-toolbar-padding: 2px 8px;
|
|
145
|
+
--mdzip-toolbar-gap: 4px;
|
|
146
|
+
--mdzip-editor-content-padding: 16px 20px;
|
|
147
|
+
--mdzip-preview-content-padding: 16px 20px 24px;
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
110
151
|
## Host Persistence
|
|
111
152
|
|
|
112
153
|
Desktop hosts can flush pending editor content, persist the returned bytes, and
|
|
@@ -171,6 +212,23 @@ selection while a host dialog is open; it returns `false` if that document has
|
|
|
171
212
|
changed. `context.convertToMdz()` runs the built-in conversion and image action
|
|
172
213
|
against the same captured selection.
|
|
173
214
|
|
|
215
|
+
## Image Insert Hook
|
|
216
|
+
|
|
217
|
+
Set `imageInsertMode` to choose the built-in image markup flow:
|
|
218
|
+
`'markdown'` keeps the default `` insertion, `'html'` inserts a
|
|
219
|
+
default `<img>` element, and `'ask'` opens a small dialog for Markdown vs HTML,
|
|
220
|
+
alt text, proportional size, and alignment.
|
|
221
|
+
|
|
222
|
+
For host-owned UI, provide `imageInsertHandler`. It receives file metadata,
|
|
223
|
+
intrinsic image size when detected, and the source (`'paste'`, `'drop'`, or
|
|
224
|
+
`'picker'`). Return `{ mode: 'markdown', altText }` or
|
|
225
|
+
`{ mode: 'html', altText, width, height, position }`; return `null` to cancel.
|
|
226
|
+
The built-in dialog asks for width, height, or percent scaling and preserves
|
|
227
|
+
aspect ratio by emitting one dimension, or proportional dimensions for percent
|
|
228
|
+
scaling. Returning `undefined` falls back to `imageInsertMode`.
|
|
229
|
+
The built-in HTML path uses portable `align` attributes for positioning because
|
|
230
|
+
the default preview sanitizer strips inline `style` attributes.
|
|
231
|
+
|
|
174
232
|
`MdzipRenderingService` uses `defaultSafeMarkdownRenderer` when no renderer is
|
|
175
233
|
injected. The default renderer sanitizes generated HTML and unsafe URL schemes.
|
|
176
234
|
|
|
@@ -332,6 +390,11 @@ under `prefers-reduced-motion`). `onPreviewRendered` fires when the text is
|
|
|
332
390
|
mounted; `onAssetsHydrated` fires once every referenced image has resolved and
|
|
333
391
|
its final `src` is assigned.
|
|
334
392
|
|
|
393
|
+
In live-editing hosts where the preview re-renders frequently, pass
|
|
394
|
+
`imageHydrationAnimation: 'initial'` to keep the first-load reveal but snap
|
|
395
|
+
images open on same-document edits. Use `'off'` to disable the loading pulse
|
|
396
|
+
and slide-open animation entirely.
|
|
397
|
+
|
|
335
398
|
## Content Security Policy (restricted hosts)
|
|
336
399
|
|
|
337
400
|
Archive images resolve to `URL.createObjectURL()` **`blob:` object URLs** (the
|
package/dist/library-info.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export declare const MDZIP_RUNTIME_LIBRARIES: readonly [{
|
|
2
2
|
readonly name: "@mdzip/editor";
|
|
3
|
-
readonly version: "1.3.
|
|
3
|
+
readonly version: "1.3.12";
|
|
4
4
|
readonly repositoryUrl: "https://github.com/mdzip-project/mdzip-editor";
|
|
5
5
|
readonly description: "MDZip workspace engine and browser UI.";
|
|
6
6
|
}, {
|
|
7
7
|
readonly name: "@mdzip/core-js";
|
|
8
|
-
readonly version: "1.3.
|
|
8
|
+
readonly version: "1.3.2";
|
|
9
9
|
readonly repositoryUrl: "https://github.com/mdzip-project/mdzip-core-js";
|
|
10
10
|
readonly description: "MDZip archive reading, writing, and validation.";
|
|
11
11
|
}, {
|
package/dist/library-info.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
export const MDZIP_RUNTIME_LIBRARIES = [
|
|
3
3
|
{
|
|
4
4
|
"name": "@mdzip/editor",
|
|
5
|
-
"version": "1.3.
|
|
5
|
+
"version": "1.3.12",
|
|
6
6
|
"repositoryUrl": "https://github.com/mdzip-project/mdzip-editor",
|
|
7
7
|
"description": "MDZip workspace engine and browser UI."
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"name": "@mdzip/core-js",
|
|
11
|
-
"version": "1.3.
|
|
11
|
+
"version": "1.3.2",
|
|
12
12
|
"repositoryUrl": "https://github.com/mdzip-project/mdzip-core-js",
|
|
13
13
|
"description": "MDZip archive reading, writing, and validation."
|
|
14
14
|
},
|
package/dist/view-css.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-css.d.ts","sourceRoot":"","sources":["../src/view-css.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"view-css.d.ts","sourceRoot":"","sources":["../src/view-css.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa,QAkuDzB,CAAC"}
|
package/dist/view-css.js
CHANGED
|
@@ -26,6 +26,49 @@ export const WORKSPACE_CSS = `
|
|
|
26
26
|
box-sizing: border-box;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
.mdzip-root.toolbar-density-compact {
|
|
30
|
+
--mdzip-density-toolbar-padding: 3px 10px;
|
|
31
|
+
--mdzip-density-toolbar-gap: 6px;
|
|
32
|
+
--mdzip-density-toolbar-start-gap: 8px;
|
|
33
|
+
--mdzip-density-toolbar-group-padding: 2px;
|
|
34
|
+
--mdzip-density-toolbar-button-width: 34px;
|
|
35
|
+
--mdzip-density-toolbar-button-height: 30px;
|
|
36
|
+
--mdzip-density-toolbar-compact-button-size: 28px;
|
|
37
|
+
--mdzip-density-toolbar-icon-size: 15px;
|
|
38
|
+
--mdzip-density-toolbar-icon-large-size: 19px;
|
|
39
|
+
--mdzip-density-toolbar-icon-extra-large-size: 22px;
|
|
40
|
+
--mdzip-density-theme-icon-size: 16px;
|
|
41
|
+
--mdzip-density-format-toolbar-gap: 4px;
|
|
42
|
+
--mdzip-density-format-toolbar-group-gap: 1px;
|
|
43
|
+
--mdzip-density-format-button-size: 28px;
|
|
44
|
+
--mdzip-density-format-menu-button-width: 36px;
|
|
45
|
+
--mdzip-density-format-icon-size: 15px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.mdzip-root.toolbar-density-dense {
|
|
49
|
+
--mdzip-density-toolbar-padding: 2px 8px;
|
|
50
|
+
--mdzip-density-toolbar-gap: 4px;
|
|
51
|
+
--mdzip-density-toolbar-start-gap: 6px;
|
|
52
|
+
--mdzip-density-toolbar-group-padding: 1px;
|
|
53
|
+
--mdzip-density-toolbar-button-width: 30px;
|
|
54
|
+
--mdzip-density-toolbar-button-height: 28px;
|
|
55
|
+
--mdzip-density-toolbar-compact-button-size: 26px;
|
|
56
|
+
--mdzip-density-toolbar-icon-size: 14px;
|
|
57
|
+
--mdzip-density-toolbar-icon-large-size: 18px;
|
|
58
|
+
--mdzip-density-toolbar-icon-extra-large-size: 20px;
|
|
59
|
+
--mdzip-density-theme-icon-size: 15px;
|
|
60
|
+
--mdzip-density-format-toolbar-gap: 3px;
|
|
61
|
+
--mdzip-density-format-toolbar-group-gap: 1px;
|
|
62
|
+
--mdzip-density-format-button-size: 26px;
|
|
63
|
+
--mdzip-density-format-menu-button-width: 34px;
|
|
64
|
+
--mdzip-density-format-icon-size: 14px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.mdzip-root.content-density-compact {
|
|
68
|
+
--mdzip-density-editor-content-padding: 20px 28px;
|
|
69
|
+
--mdzip-density-preview-content-padding: 20px 24px 32px;
|
|
70
|
+
}
|
|
71
|
+
|
|
29
72
|
.mdzip-root.mdzip-theme-light {
|
|
30
73
|
color-scheme: light;
|
|
31
74
|
${MDZIP_LIGHT_DEFAULTS_CSS}
|
|
@@ -63,11 +106,14 @@ export const WORKSPACE_CSS = `
|
|
|
63
106
|
}
|
|
64
107
|
|
|
65
108
|
.mdzip-root .toolbar {
|
|
109
|
+
--view-mode-min-left: calc(var(--editor-pane-offset) + 520px);
|
|
110
|
+
--view-mode-max-left: calc(100% - 170px);
|
|
111
|
+
|
|
66
112
|
display: grid;
|
|
67
113
|
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
68
114
|
align-items: center;
|
|
69
115
|
column-gap: 12px;
|
|
70
|
-
padding: 4px 12px;
|
|
116
|
+
padding: var(--mdzip-toolbar-padding, var(--mdzip-density-toolbar-padding, 4px 12px));
|
|
71
117
|
background: var(--mdzip-toolbar-background-color);
|
|
72
118
|
border-bottom: 1px solid var(--mdzip-border-color);
|
|
73
119
|
min-height: 48px;
|
|
@@ -81,7 +127,7 @@ export const WORKSPACE_CSS = `
|
|
|
81
127
|
display: flex;
|
|
82
128
|
align-items: center;
|
|
83
129
|
min-width: 0;
|
|
84
|
-
gap: 10px;
|
|
130
|
+
gap: var(--mdzip-toolbar-gap, var(--mdzip-density-toolbar-gap, 10px));
|
|
85
131
|
}
|
|
86
132
|
|
|
87
133
|
.mdzip-root .toolbar-start {
|
|
@@ -89,7 +135,7 @@ export const WORKSPACE_CSS = `
|
|
|
89
135
|
align-items: center;
|
|
90
136
|
justify-self: start;
|
|
91
137
|
min-width: 0;
|
|
92
|
-
gap: 12px;
|
|
138
|
+
gap: var(--mdzip-toolbar-start-gap, var(--mdzip-density-toolbar-start-gap, 12px));
|
|
93
139
|
}
|
|
94
140
|
|
|
95
141
|
.mdzip-root.navigation-pane-visible {
|
|
@@ -174,7 +220,7 @@ export const WORKSPACE_CSS = `
|
|
|
174
220
|
align-items: center;
|
|
175
221
|
gap: 4px;
|
|
176
222
|
justify-self: center;
|
|
177
|
-
padding: 3px;
|
|
223
|
+
padding: var(--mdzip-toolbar-group-padding, var(--mdzip-density-toolbar-group-padding, 3px));
|
|
178
224
|
border: 1px solid var(--mdzip-widget-border-color);
|
|
179
225
|
border-radius: 8px;
|
|
180
226
|
background: var(--mdzip-widget-background-color);
|
|
@@ -182,7 +228,11 @@ export const WORKSPACE_CSS = `
|
|
|
182
228
|
|
|
183
229
|
.mdzip-root .view-mode-toggle-group {
|
|
184
230
|
position: absolute;
|
|
185
|
-
left:
|
|
231
|
+
left: clamp(
|
|
232
|
+
var(--view-mode-min-left),
|
|
233
|
+
calc((100% + var(--workspace-pane-offset)) / 2),
|
|
234
|
+
var(--view-mode-max-left)
|
|
235
|
+
);
|
|
186
236
|
top: 50%;
|
|
187
237
|
transform: translate(-50%, -50%);
|
|
188
238
|
gap: 2px;
|
|
@@ -193,8 +243,8 @@ export const WORKSPACE_CSS = `
|
|
|
193
243
|
}
|
|
194
244
|
|
|
195
245
|
.mdzip-root .icon-toggle {
|
|
196
|
-
width: 42px;
|
|
197
|
-
height: 36px;
|
|
246
|
+
width: var(--mdzip-toolbar-button-width, var(--mdzip-toolbar-button-size, var(--mdzip-density-toolbar-button-width, 42px)));
|
|
247
|
+
height: var(--mdzip-toolbar-button-height, var(--mdzip-toolbar-button-size, var(--mdzip-density-toolbar-button-height, 36px)));
|
|
198
248
|
padding: 0;
|
|
199
249
|
cursor: pointer;
|
|
200
250
|
background: transparent;
|
|
@@ -221,16 +271,16 @@ export const WORKSPACE_CSS = `
|
|
|
221
271
|
}
|
|
222
272
|
|
|
223
273
|
.mdzip-root .toggle-icon {
|
|
224
|
-
width: 17px;
|
|
225
|
-
height: 17px;
|
|
274
|
+
width: var(--mdzip-toolbar-icon-size, var(--mdzip-density-toolbar-icon-size, 17px));
|
|
275
|
+
height: var(--mdzip-toolbar-icon-size, var(--mdzip-density-toolbar-icon-size, 17px));
|
|
226
276
|
fill: none;
|
|
227
277
|
stroke: currentColor;
|
|
228
278
|
}
|
|
229
279
|
|
|
230
280
|
.mdzip-root .view-mode-toggle {
|
|
231
281
|
position: relative;
|
|
232
|
-
width: 32px;
|
|
233
|
-
height: 32px;
|
|
282
|
+
width: var(--mdzip-toolbar-compact-button-size, var(--mdzip-density-toolbar-compact-button-size, 32px));
|
|
283
|
+
height: var(--mdzip-toolbar-compact-button-size, var(--mdzip-density-toolbar-compact-button-size, 32px));
|
|
234
284
|
border-radius: 6px;
|
|
235
285
|
color: var(--mdzip-control-foreground-color);
|
|
236
286
|
}
|
|
@@ -257,13 +307,13 @@ export const WORKSPACE_CSS = `
|
|
|
257
307
|
}
|
|
258
308
|
|
|
259
309
|
.mdzip-root .view-mode-toggle .toggle-icon {
|
|
260
|
-
width: 1.5em;
|
|
261
|
-
height: 1.5em;
|
|
310
|
+
width: var(--mdzip-toolbar-icon-large-size, var(--mdzip-density-toolbar-icon-large-size, 1.5em));
|
|
311
|
+
height: var(--mdzip-toolbar-icon-large-size, var(--mdzip-density-toolbar-icon-large-size, 1.5em));
|
|
262
312
|
}
|
|
263
313
|
|
|
264
314
|
.mdzip-root .nav-toggle {
|
|
265
|
-
width: 32px;
|
|
266
|
-
height: 32px;
|
|
315
|
+
width: var(--mdzip-toolbar-compact-button-size, var(--mdzip-density-toolbar-compact-button-size, 32px));
|
|
316
|
+
height: var(--mdzip-toolbar-compact-button-size, var(--mdzip-density-toolbar-compact-button-size, 32px));
|
|
267
317
|
border-radius: 6px;
|
|
268
318
|
}
|
|
269
319
|
|
|
@@ -272,14 +322,22 @@ export const WORKSPACE_CSS = `
|
|
|
272
322
|
color: var(--mdzip-link-color);
|
|
273
323
|
}
|
|
274
324
|
|
|
325
|
+
.mdzip-root .nav-toggle.convert-mdz-toggle {
|
|
326
|
+
color: var(--mdzip-link-color);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.mdzip-root .nav-toggle.convert-mdz-toggle:hover:not(:disabled) {
|
|
330
|
+
background: var(--mdzip-control-hover-background-color);
|
|
331
|
+
}
|
|
332
|
+
|
|
275
333
|
.mdzip-root .nav-toggle .toggle-icon {
|
|
276
|
-
width: 1.9em;
|
|
277
|
-
height: 1.9em;
|
|
334
|
+
width: var(--mdzip-toolbar-icon-extra-large-size, var(--mdzip-density-toolbar-icon-extra-large-size, 1.9em));
|
|
335
|
+
height: var(--mdzip-toolbar-icon-extra-large-size, var(--mdzip-density-toolbar-icon-extra-large-size, 1.9em));
|
|
278
336
|
}
|
|
279
337
|
|
|
280
338
|
.mdzip-root .zoom-toggle .toggle-icon {
|
|
281
|
-
width: 1.5em;
|
|
282
|
-
height: 1.5em;
|
|
339
|
+
width: var(--mdzip-toolbar-icon-large-size, var(--mdzip-density-toolbar-icon-large-size, 1.5em));
|
|
340
|
+
height: var(--mdzip-toolbar-icon-large-size, var(--mdzip-density-toolbar-icon-large-size, 1.5em));
|
|
283
341
|
}
|
|
284
342
|
|
|
285
343
|
.mdzip-root .zoom-toggle.active {
|
|
@@ -291,15 +349,15 @@ export const WORKSPACE_CSS = `
|
|
|
291
349
|
display: flex;
|
|
292
350
|
align-items: center;
|
|
293
351
|
gap: 2px;
|
|
294
|
-
padding: 3px;
|
|
352
|
+
padding: var(--mdzip-toolbar-group-padding, var(--mdzip-density-toolbar-group-padding, 3px));
|
|
295
353
|
border: 1px solid var(--mdzip-widget-border-color);
|
|
296
354
|
border-radius: 8px;
|
|
297
355
|
background: var(--mdzip-widget-background-color);
|
|
298
356
|
}
|
|
299
357
|
|
|
300
358
|
.mdzip-root .theme-toggle {
|
|
301
|
-
width: 32px;
|
|
302
|
-
height: 32px;
|
|
359
|
+
width: var(--mdzip-toolbar-compact-button-size, var(--mdzip-density-toolbar-compact-button-size, 32px));
|
|
360
|
+
height: var(--mdzip-toolbar-compact-button-size, var(--mdzip-density-toolbar-compact-button-size, 32px));
|
|
303
361
|
border-radius: 6px;
|
|
304
362
|
}
|
|
305
363
|
|
|
@@ -309,8 +367,8 @@ export const WORKSPACE_CSS = `
|
|
|
309
367
|
}
|
|
310
368
|
|
|
311
369
|
.mdzip-root .theme-toggle .toggle-icon {
|
|
312
|
-
width: 18px;
|
|
313
|
-
height: 18px;
|
|
370
|
+
width: var(--mdzip-theme-icon-size, var(--mdzip-density-theme-icon-size, 18px));
|
|
371
|
+
height: var(--mdzip-theme-icon-size, var(--mdzip-density-theme-icon-size, 18px));
|
|
314
372
|
}
|
|
315
373
|
|
|
316
374
|
.mdzip-root .workspace-shell {
|
|
@@ -412,7 +470,10 @@ export const WORKSPACE_CSS = `
|
|
|
412
470
|
gap: 9px;
|
|
413
471
|
width: 100%;
|
|
414
472
|
min-height: 34px;
|
|
415
|
-
padding:
|
|
473
|
+
/* No vertical padding: row height comes from min-height, and zero top/bottom
|
|
474
|
+
padding lets the stretched .nav-indent guide cells fill the full row so the
|
|
475
|
+
per-row rails meet between siblings instead of leaving padding-sized gaps. */
|
|
476
|
+
padding: 0 9px;
|
|
416
477
|
border: none;
|
|
417
478
|
border-radius: 4px;
|
|
418
479
|
background: transparent;
|
|
@@ -431,34 +492,73 @@ export const WORKSPACE_CSS = `
|
|
|
431
492
|
background: var(--mdzip-hover-background-color);
|
|
432
493
|
}
|
|
433
494
|
|
|
495
|
+
/* Indentation comes from per-row guide cells (.nav-indent), not container
|
|
496
|
+
margins, so each row owns its guide lines. */
|
|
434
497
|
.mdzip-root .nav-directory-children {
|
|
435
498
|
position: relative;
|
|
436
|
-
margin-left: 19px;
|
|
437
|
-
padding-left: 14px;
|
|
438
499
|
}
|
|
439
500
|
|
|
440
|
-
|
|
441
|
-
|
|
501
|
+
/* One guide cell per ancestor depth, prepended to each nested row. Fixed width
|
|
502
|
+
gives the indentation; the rails/elbow are painted within the cell at the
|
|
503
|
+
row's own height, so they never overshoot an expanded last subfolder.
|
|
504
|
+
|
|
505
|
+
--nav-guide-x positions the rail so it drops straight from the parent
|
|
506
|
+
folder's icon: the icon sits 19px (caret 10px + the 9px row gap) right of its
|
|
507
|
+
disclosure column, and because the per-level step (cell 16px + 9px gap = 25)
|
|
508
|
+
equals the rail-to-icon distance, the same offset keeps every depth aligned. */
|
|
509
|
+
.mdzip-root .nav-indent {
|
|
510
|
+
flex: 0 0 16px;
|
|
511
|
+
align-self: stretch;
|
|
442
512
|
position: relative;
|
|
513
|
+
--nav-guide-x: 19px;
|
|
443
514
|
}
|
|
444
515
|
|
|
445
|
-
|
|
446
|
-
.mdzip-root .nav-
|
|
516
|
+
/* Ancestor column with more siblings below: continuous full-height rail. */
|
|
517
|
+
.mdzip-root .nav-indent-rail::before {
|
|
447
518
|
content: "";
|
|
448
519
|
position: absolute;
|
|
449
|
-
left:
|
|
520
|
+
left: var(--nav-guide-x);
|
|
450
521
|
top: 0;
|
|
451
522
|
bottom: 0;
|
|
452
|
-
width:
|
|
523
|
+
width: 1px;
|
|
524
|
+
background: var(--mdzip-tree-guide-color);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/* Connector to this row: vertical down to the row center (elbow └), extended
|
|
528
|
+
full-height for a tee (├) when the row's folder has siblings below. */
|
|
529
|
+
.mdzip-root .nav-indent-connector::before {
|
|
530
|
+
content: "";
|
|
531
|
+
position: absolute;
|
|
532
|
+
left: var(--nav-guide-x);
|
|
533
|
+
top: 0;
|
|
534
|
+
height: 50%;
|
|
535
|
+
width: 1px;
|
|
453
536
|
background: var(--mdzip-tree-guide-color);
|
|
454
|
-
-webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 22 34' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.5 0 V17.5 H22' fill='none' stroke='black' stroke-width='1'/%3E%3C/svg%3E") left top / 22px 100% no-repeat;
|
|
455
|
-
mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 22 34' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.5 0 V17.5 H22' fill='none' stroke='black' stroke-width='1'/%3E%3C/svg%3E") left top / 22px 100% no-repeat;
|
|
456
537
|
}
|
|
457
538
|
|
|
458
|
-
.mdzip-root .nav-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
539
|
+
.mdzip-root .nav-indent-connector.nav-indent-continues::before {
|
|
540
|
+
height: 100%;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/* Horizontal arm from the connector rail to the row's caret/icon. Reaches the
|
|
544
|
+
disclosure triangle that sits one row-gap past the cell (folders). */
|
|
545
|
+
.mdzip-root .nav-indent-connector::after {
|
|
546
|
+
content: "";
|
|
547
|
+
position: absolute;
|
|
548
|
+
left: var(--nav-guide-x);
|
|
549
|
+
right: -9px;
|
|
550
|
+
top: 50%;
|
|
551
|
+
height: 1px;
|
|
552
|
+
background: var(--mdzip-tree-guide-color);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/* Files have no disclosure triangle in the caret slot, so extend the arm across
|
|
556
|
+
it (the empty 10px caret plus the 9px row gaps on either side) to meet the
|
|
557
|
+
file icon; folders keep the short arm because their triangle already sits at
|
|
558
|
+
the cell edge. The right offset is measured from the cell edge, so this holds
|
|
559
|
+
regardless of where --nav-guide-x places the rail. */
|
|
560
|
+
.mdzip-root .nav-file > .nav-indent-connector::after {
|
|
561
|
+
right: calc(-1 * (10px + 2 * 9px));
|
|
462
562
|
}
|
|
463
563
|
|
|
464
564
|
.mdzip-root .nav-caret {
|
|
@@ -746,7 +846,7 @@ export const WORKSPACE_CSS = `
|
|
|
746
846
|
.mdzip-root .edit-toolbar {
|
|
747
847
|
display: flex;
|
|
748
848
|
align-items: center;
|
|
749
|
-
gap: 7px;
|
|
849
|
+
gap: var(--mdzip-format-toolbar-gap, var(--mdzip-density-format-toolbar-gap, 7px));
|
|
750
850
|
min-height: 32px;
|
|
751
851
|
padding: 0;
|
|
752
852
|
overflow: visible;
|
|
@@ -768,7 +868,7 @@ export const WORKSPACE_CSS = `
|
|
|
768
868
|
.mdzip-root .edit-toolbar-group {
|
|
769
869
|
display: flex;
|
|
770
870
|
align-items: center;
|
|
771
|
-
gap: 2px;
|
|
871
|
+
gap: var(--mdzip-format-toolbar-group-gap, var(--mdzip-density-format-toolbar-group-gap, 2px));
|
|
772
872
|
flex: 0 0 auto;
|
|
773
873
|
}
|
|
774
874
|
|
|
@@ -777,8 +877,8 @@ export const WORKSPACE_CSS = `
|
|
|
777
877
|
align-items: center;
|
|
778
878
|
justify-content: center;
|
|
779
879
|
gap: 2px;
|
|
780
|
-
width: 32px;
|
|
781
|
-
height: 32px;
|
|
880
|
+
width: var(--mdzip-format-button-size, var(--mdzip-density-format-button-size, 32px));
|
|
881
|
+
height: var(--mdzip-format-button-size, var(--mdzip-density-format-button-size, 32px));
|
|
782
882
|
padding: 0;
|
|
783
883
|
border: 0;
|
|
784
884
|
border-radius: 5px;
|
|
@@ -803,7 +903,7 @@ export const WORKSPACE_CSS = `
|
|
|
803
903
|
}
|
|
804
904
|
|
|
805
905
|
.mdzip-root .edit-toolbar .format-menu-toggle {
|
|
806
|
-
width: 42px;
|
|
906
|
+
width: var(--mdzip-format-menu-button-width, var(--mdzip-density-format-menu-button-width, 42px));
|
|
807
907
|
gap: 2px;
|
|
808
908
|
}
|
|
809
909
|
|
|
@@ -854,8 +954,8 @@ export const WORKSPACE_CSS = `
|
|
|
854
954
|
}
|
|
855
955
|
|
|
856
956
|
.mdzip-root .format-icon {
|
|
857
|
-
width: 17px;
|
|
858
|
-
height: 17px;
|
|
957
|
+
width: var(--mdzip-format-icon-size, var(--mdzip-density-format-icon-size, 17px));
|
|
958
|
+
height: var(--mdzip-format-icon-size, var(--mdzip-density-format-icon-size, 17px));
|
|
859
959
|
fill: none;
|
|
860
960
|
stroke: currentColor;
|
|
861
961
|
}
|
|
@@ -906,7 +1006,7 @@ export const WORKSPACE_CSS = `
|
|
|
906
1006
|
.mdzip-root .preview-content {
|
|
907
1007
|
max-width: 900px;
|
|
908
1008
|
margin: 0 auto;
|
|
909
|
-
padding: 36px 32px 48px;
|
|
1009
|
+
padding: var(--mdzip-preview-content-padding, var(--mdzip-density-preview-content-padding, 36px 32px 48px));
|
|
910
1010
|
line-height: 1.55;
|
|
911
1011
|
font-size: calc(16px * var(--mdz-zoom));
|
|
912
1012
|
}
|
|
@@ -1027,6 +1127,24 @@ export const WORKSPACE_CSS = `
|
|
|
1027
1127
|
border-radius: 4px;
|
|
1028
1128
|
}
|
|
1029
1129
|
|
|
1130
|
+
.mdzip-root .preview-content img.mdzip-image-left,
|
|
1131
|
+
.mdzip-root .preview-content img.mdzip-image-wrap-left {
|
|
1132
|
+
float: left;
|
|
1133
|
+
margin: 0.25em 1em 0.75em 0;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
.mdzip-root .preview-content img.mdzip-image-right,
|
|
1137
|
+
.mdzip-root .preview-content img.mdzip-image-wrap-right {
|
|
1138
|
+
float: right;
|
|
1139
|
+
margin: 0.25em 0 0.75em 1em;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
.mdzip-root .preview-content img.mdzip-image-center {
|
|
1143
|
+
display: block;
|
|
1144
|
+
margin-left: auto;
|
|
1145
|
+
margin-right: auto;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1030
1148
|
/* Progressive image hydration. Each archive image mounts inside a collapsed
|
|
1031
1149
|
slot so the text stays compact and immediately readable; when the image
|
|
1032
1150
|
resolves, the slot eases open (0fr -> 1fr) to the height reserved from its
|
|
@@ -1044,10 +1162,24 @@ export const WORKSPACE_CSS = `
|
|
|
1044
1162
|
grid-template-rows: 1fr;
|
|
1045
1163
|
}
|
|
1046
1164
|
|
|
1165
|
+
.mdzip-root .preview-content .mdzip-image-slot.mdzip-image-animation-off {
|
|
1166
|
+
transition: none;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1047
1169
|
.mdzip-root .preview-content .mdzip-image-slot > img {
|
|
1048
1170
|
min-height: 0;
|
|
1049
1171
|
}
|
|
1050
1172
|
|
|
1173
|
+
.mdzip-root .preview-content .mdzip-image-slot.mdzip-image-align-left {
|
|
1174
|
+
float: left;
|
|
1175
|
+
margin: 0.25em 1em 0.75em 0;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
.mdzip-root .preview-content .mdzip-image-slot.mdzip-image-align-right {
|
|
1179
|
+
float: right;
|
|
1180
|
+
margin: 0.25em 0 0.75em 1em;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1051
1183
|
.mdzip-root .preview-content img.mdzip-image-loading {
|
|
1052
1184
|
background: var(--mdzip-control-background-color, rgba(127, 127, 127, 0.12));
|
|
1053
1185
|
animation: mdzip-image-pulse 1.2s ease-in-out infinite;
|
|
@@ -1234,6 +1366,29 @@ export const WORKSPACE_CSS = `
|
|
|
1234
1366
|
font-size: 13px;
|
|
1235
1367
|
}
|
|
1236
1368
|
|
|
1369
|
+
.mdzip-root .title-dialog select {
|
|
1370
|
+
width: 100%;
|
|
1371
|
+
border: 1px solid var(--mdzip-widget-border-color);
|
|
1372
|
+
background: var(--mdzip-editor-background-color);
|
|
1373
|
+
color: var(--mdzip-editor-foreground-color);
|
|
1374
|
+
border-radius: 4px;
|
|
1375
|
+
padding: 6px 8px;
|
|
1376
|
+
font-size: 13px;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
.mdzip-root .title-dialog input:disabled,
|
|
1380
|
+
.mdzip-root .title-dialog select:disabled {
|
|
1381
|
+
border-color: var(--mdzip-border-color);
|
|
1382
|
+
background: var(--mdzip-secondary-background-color);
|
|
1383
|
+
color: var(--mdzip-muted-foreground-color);
|
|
1384
|
+
opacity: 0.72;
|
|
1385
|
+
cursor: not-allowed;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
.mdzip-root .title-dialog input:disabled::placeholder {
|
|
1389
|
+
color: var(--mdzip-muted-foreground-color);
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1237
1392
|
.mdzip-root .title-dialog-validation {
|
|
1238
1393
|
color: #cf222e !important;
|
|
1239
1394
|
}
|
|
@@ -1265,6 +1420,57 @@ export const WORKSPACE_CSS = `
|
|
|
1265
1420
|
color: var(--mdzip-accent-foreground-color);
|
|
1266
1421
|
}
|
|
1267
1422
|
|
|
1423
|
+
.mdzip-root .image-insert-dialog {
|
|
1424
|
+
width: min(460px, calc(100vw - 32px));
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
.mdzip-root .image-insert-options {
|
|
1428
|
+
display: grid;
|
|
1429
|
+
gap: 6px;
|
|
1430
|
+
margin: 10px 0;
|
|
1431
|
+
padding: 10px;
|
|
1432
|
+
border: 1px solid var(--mdzip-widget-border-color);
|
|
1433
|
+
border-radius: 4px;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
.mdzip-root .image-insert-options legend {
|
|
1437
|
+
padding: 0 4px;
|
|
1438
|
+
color: var(--mdzip-muted-foreground-color);
|
|
1439
|
+
font-size: 12px;
|
|
1440
|
+
font-weight: 600;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
.mdzip-root .image-insert-options label,
|
|
1444
|
+
.mdzip-root .image-insert-field {
|
|
1445
|
+
display: grid;
|
|
1446
|
+
gap: 4px;
|
|
1447
|
+
font-size: 12px;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
.mdzip-root .image-insert-options label {
|
|
1451
|
+
grid-template-columns: auto 1fr;
|
|
1452
|
+
align-items: center;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
.mdzip-root .image-insert-options input {
|
|
1456
|
+
width: auto;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
.mdzip-root .image-insert-grid {
|
|
1460
|
+
display: grid;
|
|
1461
|
+
grid-template-columns: 1fr 1fr;
|
|
1462
|
+
gap: 8px;
|
|
1463
|
+
margin-top: 8px;
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
.mdzip-root .image-insert-field {
|
|
1467
|
+
margin-top: 8px;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
.mdzip-root .image-insert-field.field-disabled {
|
|
1471
|
+
color: var(--mdzip-muted-foreground-color);
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1268
1474
|
.mdzip-root .metadata-dialog dl {
|
|
1269
1475
|
margin: 12px 0 0;
|
|
1270
1476
|
}
|
|
@@ -1355,11 +1561,9 @@ export const WORKSPACE_CSS = `
|
|
|
1355
1561
|
.mdzip-root { --nav-pane-width: 220px; }
|
|
1356
1562
|
}
|
|
1357
1563
|
|
|
1358
|
-
/* Stack the formatting toolbar
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
280px) navigation pane open everything shifts right, so stack earlier. */
|
|
1362
|
-
@media (max-width: 1000px) {
|
|
1564
|
+
/* Stack the formatting toolbar only once the pushed-right view-mode toggle no
|
|
1565
|
+
longer has enough room between the edit tools and the right-side controls. */
|
|
1566
|
+
@media (max-width: 760px) {
|
|
1363
1567
|
.mdzip-root .toolbar {
|
|
1364
1568
|
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
1365
1569
|
row-gap: 4px;
|
|
@@ -1388,7 +1592,7 @@ export const WORKSPACE_CSS = `
|
|
|
1388
1592
|
}
|
|
1389
1593
|
}
|
|
1390
1594
|
|
|
1391
|
-
@media (max-width:
|
|
1595
|
+
@media (max-width: 1100px) {
|
|
1392
1596
|
.mdzip-root.navigation-pane-visible .toolbar {
|
|
1393
1597
|
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
1394
1598
|
row-gap: 4px;
|
package/dist/view-css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-css.js","sourceRoot":"","sources":["../src/view-css.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,MAAM,wBAAwB,GAAG,qBAAqB,CAAC,UAAU,C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